package com.xxxx.rpc;

import com.xxxx.rpc.service.SearchService;
import com.xxxx.rpc.service.impl.SearchServiceImpl;
import com.xxxx.rpc.vo.GoodsVo;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lsh
 * @date 2021/1/4 13:35
 */
@SpringBootApplication
@MapperScan("com.xxxx.rpc.mapper")
@Controller
public class RpcApplication {
    public static void main(String[] args) {
        SpringApplication.run(RpcApplication.class,args);

    }
    @Resource
    private SearchTest test;
    @RequestMapping("/search")
    @ResponseBody
    public List<GoodsVo> search(String searchStr, Integer x, Integer y){
        return test.get().doSearch(searchStr,x,y);
    }
}
